package com.face.getface.config;

import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;

/**
 * 人脸对比工具类
 *
 * @author juwujie
 * @date 2024-08-06
 */
public class ConfigReader {
    private Properties properties;

    public ConfigReader(String filePath) {
        try (FileInputStream fileInputStream = new FileInputStream(filePath)) {
            properties = new Properties();
            properties.load(fileInputStream);
        } catch (IOException e) {
            throw new RuntimeException("Failed to load the properties file: " + filePath, e);
        }
    }

    public String getAppId() {
        return properties.getProperty("app.id");
    }

    public String getApiKey() {
        return properties.getProperty("api.key");
    }

    public String getSecretKey() {
        return properties.getProperty("secret.key");
    }
}
